Field of the Invention
This invention relates generally to the field of computer processors. More particularly, the invention relates to an apparatus and method for filtered coarse pixel shading.
Description of the Related Art
Coarse Pixel Shading (CPS) is an extension of the standard rasterization pipeline which implements a limited subset of decoupled shading. Simple, yet powerful, it can be regarded as generalization of multi-sample antialiasing (MSAA), where multiple render target samples per pixel are colored by the same shader evaluation. Motivated by increasing display resolutions, power-efficiency and perceptual considerations, CPS reuses the same shader evaluation across multiple pixels, while keeping the visibility super-sampled.
By construction, CPS inherits one quality issue of MSAA, which goes normally unnoticed in real-time rendering. The shader evaluation, which is now decoupled from visibility sampling, may no longer happen at a screen space location covered by the rasterized primitive. As shading is usually evaluated at pixel centers, partially covered pixels extrapolate the vertex attributes. This can lead to various artifacts, especially during texture sampling. Though centroid interpolation addresses this problem, it can lead to other artifacts causing temporal flickering and revealing internal triangle edges.
The reduction in shader evaluations takes effect when the rendered primitives cover several coarse shading pixels on the screen. Akin to standard rasterization pipelines, shading samples are not reused across triangle borders. For smaller triangles, which are getting more weight in modern workloads, shading cannot decrease below 2×2 coarse pixels per primitive, as the smallest unit of shading is a quad.
The need to further reduce the shading rate, making shading pixels even coarser, calls for a better color reconstruction of visibility samples than nearest neighbor sampling. Using filtering for CPS requires the evaluation of more shading quads around triangle boundaries, which amplifies the existing limitations: more redundant pixels will be interpolated, and attribute extrapolation becomes an even greater issue. Preliminary evaluations of bilinear filtering with CPS verified the existence of the artifacts.